import React from "react";
export default class App extends React.Component{
    render(){
        return(
            <div>hh</div>
        )
    }
}

let center={
    subscribers:[],
    subscribe(callback){
        this.subscribers.push(callback)
    },
    publish(value){
        this.subscribers.forEach(callback=>callback(value))
    }
}

center.subscribe((value)=>{
    console.log('小王订阅的'+value+'更新了!')
})
center.subscribe((value)=>{
    console.log('小李订阅的'+value+'更新了!')
})
center.publish('人民日报')